﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Net;
using System.Text;

namespace SampleApp.RemoteInclude
{
    public partial class RemoteInclude : System.Web.UI.UserControl
    {
        [Bindable(true), DefaultValue("")]
        public string URL
        {
            get { return ViewState["urlinclude"].ToString(); }
            set { ViewState["urlinclude"] = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            var cl = new WebClient();
            try
            {
				cl.Encoding = Encoding.UTF8;
                SiteResponse.Text = cl.DownloadString(this.URL);
            }
            catch
            {
                SiteResponse.Text = "Not found";
            }
        }
    }
}